﻿using Microsoft.AspNetCore.Mvc;
using SSO.OAuth.Models;
using SSO.OAuth.Util;

namespace SSO.OAuth.Controllers;

/// <summary>
/// 授权信息获取
/// </summary>
public class AccountController (IJWTService jwtService) : Controller {
    /// <summary>
    /// 根据授权码,获取Token
    /// </summary>
    [HttpPost]
    public ResponseModel<GetTokenDTO> GetToken ([FromBody] GetTokenRequestDto request) {
        var result = jwtService.GetTokenWithRefresh(request.authCode);
        return result;
    }
}